package org.base.common.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
public class BasePojo {
    /**
     * ID
     */
    private Long id;

    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.DEFAULT)
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, insertStrategy = FieldStrategy.DEFAULT)
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, insertStrategy = FieldStrategy.DEFAULT, updateStrategy = FieldStrategy.NEVER)
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, insertStrategy = FieldStrategy.DEFAULT, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime updateTime;

    /**
     * 删除标记， 默认0未删除，1已删除
     */
    @TableLogic
    @JsonIgnore
    private Boolean isDeleted;

}
